import time
import unittest

import app
from lib.HTMLTestRunner import HTMLTestRunner
from script.test02_login_params import TestLoginAPI1

suite = unittest.TestSuite()
# 执行指定测试类下的测试方法
suite.addTest(unittest.makeSuite(TestLoginAPI1))
# 执行指定测试类的全部方法
report = app.BASE_DIR + "/report/{}.html".format(time.strftime("%Y%m%d_%H%M%S"))
# 打开文件流
with open(report, "wb") as f:
    # 创建执行器
    runner = HTMLTestRunner(f, title="IHRM Login API Test Report")
    # 执行测试套件
    runner.run(suite)


